<html>

<head>
    <style>
        #box {
            width: 0;
            height: 50px;
            background-color: tomato;
        }
    </style>
</head>

<body>
    <div>这是一段描述文字</div>
    <script>
        const removeTag = (fragment) => {
            let c = new DOMParser().parseFromString(fragment, 'text/html').body.innerText
            console.log(c);
        }
        removeTag(" <div>这是一段描述文字111</div>")


        //    /    ([^?&-]+)=([^&]+)    /g



        const parseQuery = (url) => {
            q = {};
            url.replace(/([^?&-]+)=([^&]+)/g, (match, k, v, matchIdx, originStr) => {
                // console.log(match, k, v, matchIdx, originStr);
                q[k] = v
            })
            return q
        }
        const res1 = parseQuery("http://xxx.com?a=11&b=22&c=33&d=44")
        const res2 = parseQuery("name=zs&age=16")
        // console.log(res1, res2);



        // const pick = (obj, ...props) => {
        //     let r = Object.entries(props);
        //     console.log(r, "@@");
        //     // return Object.fromEntries( Object.entries(obj).filter(([k]) => props.includes(k)) )
        // }
        // let res = pick({ name: 'zs', age: 18, friend: 'lisi' }, 'name', 'age')
        // console.log(res, "###");


        let str = "http://xxx.com?a=11&b=22&c=33&d=44"
        let reg = /[^?]+=[^&]+/g
    </script>
</body>

</html>